package com.mawendaxiong.blogprovider.blogMain.mapper;

import com.mawendaxiong.blogprovider.blogMain.entity.BlogMain;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author mawendaxiong
 * @since 2020-06-24
 */
@Repository
@Mapper
public interface BlogMainMapper extends BaseMapper<BlogMain> {

    @Select("select * from BlogMain where type=#{typeKid} and isDel = 0;")
    List<BlogMain> getBlogsByType(String typeKid);

    @Select("select * from BlogMain where kid=#{blogKid} and isDel = 0;")
    BlogMain getBlogDetail(String blogKid);
}
